import {observable, computed, action} from 'mobx'
import {createContext} from 'react'
import ChildrenPageUtils from '@/store/extends'
import {uSelectDevStatusAndSimpleData} from '@/api/setting'

class Devinfo extends ChildrenPageUtils {
  @observable pageData: Setting.DevBaseInfo | null = null
  @action.bound
  async updatePageDataSource() {
    if (!this.pageQuery.devId) return
    let res = await uSelectDevStatusAndSimpleData({
      devId: this.pageQuery.devId
    }).catch(err => {})
    if (res) {
      this.pageData = res.data
    }
  }
}
export const devInfoStore = createContext(new Devinfo())
